/* 
 * File:   BGStone.cpp
 * Author: Davit Vardanyan
 * 
 * Created on December 16, 2012, 6:16 PM
 */

#include "BGStone.h"
#include <stdio.h>

BGStone::BGStone() {
}

BGStone::BGStone(const BGStone& orig) {
}

BGStone::~BGStone() {
}

void BGStone::createStone(int t, float r, bool e)
{
        tag = t;
        radius = r;
        enable = e;
}

BGPoint BGStone::getPosition()
{
    return position;
}

void BGStone::setPosition(BGPoint point)
{
    position.x = point.x;
    position.y = point.y;
}

void BGStone::setRadius(float r)
{
    radius = r;
}

float BGStone::getRadius()
{
    return radius;
}

void BGStone::setTag(int t)
{
    tag = t;
}

int BGStone::getTag()
{
    return tag;
}

void BGStone::setEnabled(bool e) 
{
    enable = e;
}

bool BGStone::getEnabled()
{
    return enable;
}

void BGStone::draw(GLuint texture)
{
    glPushMatrix();
    glBindTexture(GL_TEXTURE_2D, texture);
    glColor4f(1.0, 1.0, 1.0, 1.0);
    glTranslatef(position.x, position.y, 0.0);
    glBegin(GL_QUADS);
        glTexCoord2f(0.0, 0.0);
        glVertex3f(-radius, -radius, 1.1);
        glTexCoord2f(1.0, 0.0);
        glVertex3f(radius, -radius, 1.1);
        glTexCoord2f(1.0, 1.0);
        glVertex3f(radius, radius, 1.1);
        glTexCoord2f(0.0, 1.0);
        glVertex3f(-radius, radius, 1.1);
    glEnd();
    glPopMatrix();
}

void BGStone::setStackIndex(int index)
{
    stackIndex = index;
}

int BGStone::getStackIndex()
{
    return stackIndex;
}

